<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>伪对象选择符 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="gitbook/style.css">
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="./伪类选择符.html" />
    
    
    <link rel="prev" href="./群组选择符.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1.6"
        data-chapter-title="伪对象选择符"
        data-filepath="伪对象选择符.md"
        data-basepath="."
        data-revision="Fri Sep 01 2017 15:57:44 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="CSS选择符.html">
            
                
                    <a href="./CSS选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        CSS选择符
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="CSS的www.html">
            
                
                    <a href="./CSS的www.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        CSS的www
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="CSS的引入.html">
            
                
                    <a href="./CSS的引入.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        CSS的引入
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="ID及class选择符.html">
            
                
                    <a href="./ID及class选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        ID及class选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="关系选择符.html">
            
                
                    <a href="./关系选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        关系选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="群组选择符.html">
            
                
                    <a href="./群组选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        群组选择符
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="1.6" data-path="伪对象选择符.html">
            
                
                    <a href="./伪对象选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        伪对象选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="伪类选择符.html">
            
                
                    <a href="./伪类选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        伪类选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="属性选择符.html">
            
                
                    <a href="./属性选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        属性选择符
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="CSS样式.html">
            
                
                    <a href="./CSS样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS样式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="CSS字体，颜色和文本属性.html">
            
                
                    <a href="./CSS字体，颜色和文本属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        CSS字体，颜色和文本属性
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="Bootstrap.html">
            
                
                    <a href="./Bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Bootstrap
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="&#x4F2A;&#x5BF9;&#x8C61;&#x9009;&#x62E9;&#x7B26;">&#x4F2A;&#x5BF9;&#x8C61;&#x9009;&#x62E9;&#x7B26;(::)</h2>
<ul>
<li><p>E:first-letter/E::first-letter        &#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x5185;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x7684;&#x6837;&#x5F0F;&#x3002;</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;style&gt;    
      div::first-letter{
          color: red ;
      }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          111
      &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
&#x7ED3;&#x679C;&#xFF1A;&#x7B2C;&#x4E00;&#x4E2A;1&#x53D8;&#x7EA2;
</code></pre></li>
<li><p>E:first-line/E::first-line        &#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x5185;&#x7684;&#x7B2C;&#x4E00;&#x884C;&#x7684;&#x6837;&#x5F0F;&#x3002;</p>
</li>
</ul>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;UTF-8&quot;&gt;
        &lt;title&gt;&lt;/title&gt;
        &lt;style&gt;    
        div::first-line{
            color: red ;
        }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div&gt;
            111&lt;br/&gt;
            asd&lt;br/&gt;
            222&lt;br/&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
&#x7ED3;&#x679C;&#xFF1A;1111&#x53D8;&#x7EA2;
</code></pre><ul>
<li><p>E:before/E::before   &#x8BBE;&#x7F6E;&#x5728;&#x5BF9;&#x8C61;&#x524D;&#xFF08;&#x4F9D;&#x636E;&#x5BF9;&#x8C61;&#x6811;&#x7684;&#x903B;&#x8F91;&#x7ED3;&#x6784;&#xFF09;&#x53D1;&#x751F;&#x7684;&#x5185;&#x5BB9;&#x3002;&#x7528;&#x6765;&#x548C;content&#x5C5E;&#x6027;&#x4E00;&#x8D77;&#x4F7F;&#x7528;</p>
</li>
<li><p>E:after/E::after    &#x8BBE;&#x7F6E;&#x5728;&#x5BF9;&#x8C61;&#x540E;&#xFF08;&#x4F9D;&#x636E;&#x5BF9;&#x8C61;&#x6811;&#x7684;&#x903B;&#x8F91;&#x7ED3;&#x6784;&#xFF09;&#x53D1;&#x751F;&#x7684;&#x5185;&#x5BB9;&#x3002;&#x7528;&#x6765;&#x548C;content&#x5C5E;&#x6027;&#x4E00;&#x8D77;&#x4F7F;&#x7528;</p>
</li>
</ul>
<blockquote>
<p>before &#x548C;after&#x5FC5;&#x987B;&#x548C;content&#x7ED3;&#x5408;&#x4F7F;&#x7528;&#xFF0C;&#x5373;&#x4F7F;&#x6CA1;&#x6709;&#x5185;&#x5BB9;&#x63D2;&#x5165;&#x4E5F;&#x8981;&#x5199;content=&apos; &apos;</p>
<pre><code>    &#x4F8B;&#x5982;&#xFF1A;
</code></pre><p>```
poem:before{
    content: &quot;(&quot;;
}
poem:after{
    content: &quot;)&quot;;
}</p>
</blockquote>
<p id="poem">111</p>

<p>&#x7ED3;&#x679C;:(111)</p>
<pre><code>
* E::placeholder        &#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x6587;&#x5B57;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x6837;&#x5F0F;&#x3002;
</code></pre><p>&lt;!DOCTYPE html&gt;</p>
<p><html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style><br>            input::-webkit-input-placeholder{
                color: darkblue;
            }</p>
<pre><code>    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

    &lt;input type=&quot;test&quot; placeholder=&quot;&quot; /&gt;
&lt;/body&gt;
</code></pre><p>&lt;/html&gt;</p>
<pre><code>
* E::selection        设置对象被选择时的颜色。
</code></pre><p>&lt;!DOCTYPE html&gt;</p>
<p><html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>    
            /*文字选中的加量效果*/
            div::-moz-selection{
                background:red;
                color:yellow;}
            div::selection{background:red;
                color:yellow;}
        </style>
    </head>
    <body>
        <div>
            111
            asd
            222
        </div>
    </body>
</html>
&#x7ED3;&#x679C;&#x662F;&#xFF1A;&#x80CC;&#x666F;&#x7EA2;&#x8272;&#xFF0C;&#x5B57;&#x4F53;&#x662F;&#x9EC4;&#x8272;
```</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="./群组选择符.html" class="navigation navigation-prev " aria-label="Previous page: 群组选择符"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="./伪类选择符.html" class="navigation navigation-next " aria-label="Next page: 伪类选择符"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

    
    <script src="gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
